package com.lyEducation.security.config;

import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.PrintWriter;

@RestController
public class RegLoginController {
  @RequestMapping("/login_p")
  public void login(HttpServletResponse resp, HttpServletRequest request) throws IOException {
    resp.setStatus(HttpServletResponse.SC_UNAUTHORIZED);
    resp.setContentType("application/json;charset=UTF-8");
    PrintWriter out = resp.getWriter();
    out.write("{\"status\":\"error\",\"msg\":\"尚未登录,令牌过期,异地登录被挤下线,请登录!\"}");
    out.flush();
    out.close();
    //        return new RespBean("error", "尚未登录，请登录!");
  }
}
